package com.zhixiang.core.util;

/**
 * Response JsonResult for RESTful <br> 封装 返回Json 格式数据
 *
 * @author wanghuawen
 * @since 2015年11月13日
 **/
public class JsonResult
{

    /**
     * 是否成功
     */
    private boolean success;

    /**
     * 数据的条数
     */
    private Integer totalCounts = 0;

    /**
     * 数据
     */
    private Object result;

    /**
     * 信息
     */
    private String msg;

    public Object getResult()
    {
        return result;
    }

    public void setResult(Object result)
    {
        this.result = result;
    }

    public String getMsg()
    {
        return msg;
    }

    public void setMsg(String msg)
    {
        this.msg = msg;
    }

    public boolean isSuccess()
    {
        return success;
    }

    public void setSuccess(boolean success)
    {
        this.success = success;
    }

    public Integer getTotalCounts()
    {
        return totalCounts;
    }

    public void setTotalCounts(Integer totalCounts)
    {
        this.totalCounts = totalCounts;
    }
    
    public JsonResult()
    {
        super();
    }

    public JsonResult(boolean success, Integer totalCounts, Object result, String msg)
    {
        super();
        this.success = success;
        this.totalCounts = totalCounts;
        this.result = result;
        this.msg = msg;
    }

    public JsonResult(boolean success, String msg)
    {
        super();
        this.success = success;
        this.msg = msg;
    }

    public JsonResult(boolean success, Integer totalCounts, Object result)
    {
        super();
        this.success = success;
        this.totalCounts = totalCounts;
        this.result = result;
    }

    public JsonResult(boolean success)
    {
        super();
        this.success = success;
    }
}
